package cn.tedu.boot04.mapper;

import cn.tedu.boot04.entity.Product;
import org.apache.ibatis.annotations.*;

import java.util.List;
@Mapper
public interface ProductMapper {
    @Insert("INSERT INTO product VALUES(NULL,#{title},#{price},#{num} )")
    int insert(Product product);
    @Select("SELECT * FROM product")
    List<Product> select();
    @Update("UPDATE product SET title=#{title},price=#{price},num=#{num} WHERE id=#{id}")
    int update(Product product);
    @Delete("DELETE FROM product WHERE id=#{id}")
    int delete(int id);
}
